home *** CD-ROM | disk | FTP | other *** search
/ Pascal Super Library / Pascal Super Library (CW International)(1997).bin / LIBRARY / WINRES / PROFILE.TXT < prev    next >
Text File  |  1994-09-15  |  6KB  |  212 lines

  1.  Unit Profile
  2.  ▀▀▀▀▀▀▀▀▀▀▀▀
  3.  
  4. The Profile unit provides access to INI files in Windows' style for
  5. DOS and DPMI applications. File access is done via a specially adapted
  6. buffered stream for optimal speed. The procedures are compatible to
  7. these defined in Windows' API.
  8.  
  9.  Unit Profile: Functions and Procedures 
  10.  Copyright                              
  11.  
  12.  
  13.  Unit Profile: Functions and Procedures
  14.  ▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀
  15.  
  16.  GetPrivateProfileInt     
  17.  GetPrivateProfileString  
  18.  WritePrivateProfileString
  19.  
  20.  See also:  Unit Profile
  21.  
  22.  GetPrivateProfileInt          (Unit Profile)
  23.  ▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀
  24.  function GetPrivateProfileInt(ApplicationName, KeyName: PChar;
  25.    Default: Integer; FileName: PChar): Word;
  26.  
  27. This functions retrieves the integer value of a certain entry
  28. in a certain INI file.
  29.  
  30.  Parameter         Description
  31.  ───────────────────────────────────────────────────────────────────────────
  32.  ApplicationName   Null-terminated string, stating the section name.
  33.  KeyName           Null-terminated string, stating the key name whose
  34.                    value is to be retrieved.
  35.  Default           Integer value to be returned if the key is not present.
  36.                    Must be a positive integer from 0 to 32,767.
  37.  Filename          Null-terminated file name.
  38.  
  39. Returns:
  40.  
  41. The functions returns the integer value of the entry specified if the
  42. function was successful. If the entry does not exist, the Default value
  43. is returned. If the entry is non-integer, 0 is returned.
  44.  
  45. Note:
  46.  
  47. The integer value can be followed by non-numeric characters, which are
  48. ignored. The case of the keywords is ignored. Hexadecimal notation
  49. is not recognized.
  50.  
  51. See also:
  52.  
  53.  GetPrivateProfileString
  54.  INI File Format        
  55.  
  56.  
  57.  GetPrivateProfileString       (Unit Profile)
  58.  ▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀
  59.  function GetPrivateProfileString(ApplicationName, KeyName: PChar;
  60.    Default: PChar; ReturnedString: PChar; Size: Integer;
  61.    FileName: PChar): Integer;
  62.  
  63. This function retrieves a string from a certain entry in an INI file.
  64.  
  65.  Parameter         Description
  66.  ───────────────────────────────────────────────────────────────────────────
  67.  ApplicationName   Null-terminated string, stating the section name.
  68.  KeyName           Null-terminated string, stating the key name.
  69.  Default           Null-terminated string, which is copied if the
  70.                    specified entry is not available. This parameter
  71.                    must not be NIL.
  72.  ReturnedString    The buffer, to which the string is to be copied.
  73.  Size              The size of the buffer.
  74.  Filename          Null-terminated file name.
  75.  
  76. Returns:
  77.  
  78. The function returns the number of characters copied to the buffer, without
  79. the terminating NUL characters.
  80.  
  81. Note:
  82.  
  83. The functions searches the specified section of the INI file for an entry
  84. named KeyName. If found, the string value is copied to the buffer. If not,
  85. the Default string is copied.
  86. If Keyname is set NIL, the function will copy all names of the specified
  87. section to the buffer. Each name is null-terminated, and the buffer is
  88. terminated by another NUL character.
  89. If the string linked with Keyname is given with (single or double)
  90. quotation marks, these characters are removed.
  91. The case of the keywords is ignored.
  92.  
  93. See also:
  94.  
  95.  WritePrivateProfileString
  96.  INI File Format          
  97.  
  98.  
  99.  WritePrivateProfileString     (Unit Profile)
  100.  ▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀
  101.  function WritePrivateProfileString(ApplicationName, KeyName, Str,
  102.    FileName: PChar): Boolean;
  103.  
  104. This function copies a string into a certain section of an INI file.
  105.  
  106.  Parameter         Description
  107.  ───────────────────────────────────────────────────────────────────────────
  108.  ApplicationName   Null-terminated string, stating the section name.
  109.                    If the section does not exist, it is created. The
  110.                    case is ignored.
  111.  KeyName           Null-terminated string, stating the key name.
  112.                    Set KeyName NIL if the whole section is to be deleted.
  113.  Str               Null-terminated string, stating the new value of
  114.                    the entry. Set Str NIL if this entry is to be deleted.
  115.  Filename          Null-terminated file name. If non-existing, the
  116.                    file is created.
  117.  
  118. Returns:
  119.  
  120. The function returns TRUE if it was successful.
  121.  
  122. Note:
  123.  
  124. For improving performance of access, the Profile unit leaves accessed
  125. INI files open. For closing the file, call this function with all four
  126. parameters set NIL.
  127.  
  128. See also:
  129.  
  130.  INI File Format
  131.  
  132.  
  133.  INI File Format
  134.  ▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀
  135.  
  136. INI files are text files. They consist of several so-called application
  137. sections.
  138.  
  139.  [Section1]
  140.       :
  141.       :
  142.  [Section2]
  143.       :
  144.       :
  145.       :
  146.  [LastSection]
  147.       :
  148.       :
  149.  
  150. In each section there are entries of the following format:
  151.  
  152.  Entry1=1000
  153.  Entry=no
  154.       :
  155.  LastEntry=Example
  156.  
  157. Left of the equal sign there is the so-called keyword, which identifies
  158. the entry. You refer to this keyword to retrieve or change the value of
  159. an entry. This value is to be found to the right of the equal sign.
  160.  
  161. See also:
  162.  
  163.  Unit Profile
  164.  
  165.  
  166.  Copyright and
  167.  Disclaimer of Warranty
  168.  ▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀
  169.  
  170. The files of the software product provided as a whole are called Software.
  171.  
  172.  Copyright
  173.  
  174.  The Software is neither "Public Domain",
  175.  nor "Freeware". The Software is protected
  176.  by the laws of the Federal Republic of
  177.  Germany and international agreements.
  178.  
  179.  Copyright (C) 1993, 1994 Matthias Köppe,
  180.  Erzbergerstraße 12, D-39104 Magdeburg.
  181.  All rights reserved.
  182.  
  183.  Disclaimer of Warranty
  184.  
  185.  The Software is supplied as is. The authors
  186.  disclaim all warranties, expressed or
  187.  implied, including but not limited to the
  188.  warranties of merchantability and of fitness
  189.  for any purpose. The authors assume no
  190.  liability for damages, direct or
  191.  consequential, which may result from
  192.  the use of the Software.
  193.  
  194.  General Agreement
  195.  
  196.  Using the Software, you agree to the general
  197.  agreement, which is stated in the file
  198.  SOFTWARE.DOC.
  199.  
  200.  If you have a copy of the Software that
  201.  doesn't include this file, refer to:
  202.  
  203.  Matthias Koeppe
  204.  MKM GbR f. Softwareentwicklung
  205.  Erzbergerstraße 12
  206.  D-39104 Magdeburg
  207.  GERMANY
  208.  
  209.  Phone/Fax  +49-391-5 43 01 28
  210.  CIS        [100331,174]
  211.  
  212.